@extends('backend::layout')
@section('title',$page_title)
@section('content')
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                    <table class="list table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>
                                @component('backend::component.checkbox')
                                    @slot('name') ids-all @endslot
                                @endcomponent
                            </th>
                            <th>申请人</th>
                            <th>充值数量</th>
                            <th>申请时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($list as $item)

                            <tr>
                                <td class="text-truncate">
                                    @component('backend::component.checkbox')
                                        @slot('name') id[] @endslot
                                        @slot('class') id @endslot
                                        @slot('value') {{$item->id}} @endslot
                                    @endcomponent
                                </td>
                                <td class="text-truncate text-more-hide">
                                    {{$item->user->user_number}}[{{$item->user->real_name}}]
                                    <br/>手机号:{{$item->user->user_phone}}
                                </td>
                                <td>{{$item->money}}</td>
                                <td>{{$item->created_at}}</td>
                                <td>
                                    @switch($item->status)
                                        @case(1) 已充值 @break
                                        @case(-1) 拒绝 @break
                                        @default 待审核
                                    @endswitch
                                </td>
                                <td class="text-truncat mr-1">
                                    @component('backend::component.form.button')
                                        @slot('title') 拒绝 @endslot
                                        @slot('class') btn-ajax @endslot
                                        @slot('color') danger @endslot
                                        @slot('params') {"prompt":{"name":"remark"},"method":"post","confirm":true,"url":"{{route('b_Recharge_rgRefuse',['id'=>$item->id])}}"} @endslot
                                        @slot('icon') hcl-circle-jian @endslot
                                    @endcomponent
                                    @component('backend::component.form.button')
                                        @slot('title') 同意 @endslot
                                        @slot('class') btn-ajax @endslot
                                        @slot('color') success @endslot
                                        @slot('params') {"confirm":true,"url":"{{route('b_Recharge_rgAgree',['id'=>$item->id])}}"} @endslot
                                        @slot('icon') hcl-bjyd @endslot
                                    @endcomponent

                                    @component('backend::component.form.button')
                                        @slot('title') 详情 @endslot
                                        @slot('elem') a @endslot
                                        @slot('href') {{route('b_Recharge_detail',['id'=>$item->id])}} @endslot
                                        @slot('icon') hcl-wangye @endslot
                                        @slot('color') primary @endslot
                                    @endcomponent
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    @if($list->total()>$list->perPage())
                        @slot('list_page')
                            {{$list->links('backend::public.pagination')}}
                        @endslot
                    @endif
            @else
                @include('backend::public.empty_page',['info'=>'暂时没有充值记录'])
            @endif
        @endslot
    @endcomponent
@endsection